<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <title>选择学生</title>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">

    <script type="text/javascript">
        var customOBJ;
        var clazzList = ${clazzListJson};
        $(function(){

            $('#dataList2').datagrid({
               /// title: '学生列表',
                iconCls: 'icon-more',//图标
                border: true,
                collapsible: false,//是否可折叠的
                fit: true,//自动大小
                method: "post",
                url: "/student/get_list?t=" + new Date().getTime(),
                idField: 'id',
                singleSelect: false,//是否单选
                pagination: true,//分页控件
                rownumbers: true,//行号
                sortName: 'id',
                sortOrder: 'DESC',
                remoteSort: false,
                onLoadSuccess:function(data){
                    //alert(data.rows.length);
                },
                onDblClickRow:function(rowIndex, rowData){
                    customOBJ=new Object();
                    customOBJ.sid=rowData.id;
                    customOBJ.sname=rowData.username;
                    setCustomobjName(customOBJ);
                    closeCustomWin();
                },
                columns:[[
                    {field:'chk',checkbox: true,width:50},
                    {field:'id',title:'ID',width:50, sortable: true},
                    {field:'photo',title:'头像',width:100,
                        formatter:function(value,index,row){
                            return '<img src='+value+' width="100px" />';
                        }
                    },
                    {field:'username',title:'姓名',width:150, sortable: true},
                    {field:'sn',title:'学号',width:150, sortable: true},
                    {field:'sex',title:'性别',width:150, sortable: true},
                    {field:'clazzId',title:'所属班级',width:150, sortable: true,
                        formatter:function(value,index,row){
                            for(var i=0;i<clazzList.length;i++){
                                if(clazzList[i].id == value){
                                    return clazzList[i].name;
                                }
                            }
                            return value;
                        }
                    },
                    {field:'password',title:'密码',width:150},
                    {field:'remark',title:'备注',width:200}
                ]],
                toolbar: "#toolbar2"
            });

        }) ;
       /* function searchCustomobj(){
            var customobjName = $('#customobjName').val();
            var queryParams = $('#customobjList').datagrid('options').queryParams;
            queryParams.seachCustomobjName=customobjName;
            $('#customobjList').datagrid('reload');
        }
*/
        /*查询*/
        $("#search-btn2").click(function () {
            $('#dataList2').datagrid('reload',{
                name:$("#search-name2").textbox('getValue'),
                syear:$("#search-syear2").textbox('getValue')
            });
        });
    </script>
</head>
<div id="toolbar2">
    学生名：<input id="search-name2" class="easyui-textbox" />
    毕业年份：<select id="search-syear2" class="easyui-combobox" style="width: 150px;">
    <option value="">全部</option>
    <c:forEach var="grade" varStatus="status" items="${gadeYearJson}">
        <option value="${grade.name}">${grade.name}</option>
    </c:forEach>


</select>
    <a id="search-btn2" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索</a>
</div>
</div>

    <table id="dataList2" cellspacing="0" cellpadding="0" border="1">
    </table>


</html>